package com.cong.juc.enums;


/**
 * @author cong
 * <p>
 * created on 2021/3/31 上午10:11
 */

public enum CountryEnum {
    QI(1, "齐"),
    CU(2, "楚"), YAN(3, "燕"), HAN(4, "韩"), ZHAO(5, "赵"), WEI(6, "魏"), QIN(7, "秦");
    private Integer retCode;
    private String name;

    CountryEnum(Integer retCode, String name) {
        this.retCode = retCode;
        this.name = name;
    }

    public static CountryEnum forEachCountryEnum(int key){
        CountryEnum[] countryEnums = CountryEnum.values();
        for (CountryEnum countryEnum : countryEnums) {
            if (key==countryEnum.getRetCode())
                return countryEnum;
        }
        return null;
    }

    public Integer getRetCode() {
        return retCode;
    }

    public void setRetCode(Integer retCode) {
        this.retCode = retCode;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
